var post_id=0,post_rating=0,is_being_rated=!1;ratingsL10n.custom=parseInt(ratingsL10n.custom);ratingsL10n.max=parseInt(ratingsL10n.max);ratingsL10n.show_loading=parseInt(ratingsL10n.show_loading);ratingsL10n.show_fading=parseInt(ratingsL10n.show_fading); function current_rating(a,b,c){if(!is_being_rated){post_id=a;post_rating=b;if(ratingsL10n.custom&&2==ratingsL10n.max)jQuery("#rating_"+post_id+"_"+b).attr("src",eval("ratings_"+b+"_mouseover_image.src"));else for(i=1;i<=b;i++)ratingsL10n.custom?jQuery("#rating_"+post_id+"_"+i).attr("src",eval("ratings_"+i+"_mouseover_image.src")):jQuery("#rating_"+post_id+"_"+i).attr("src",ratings_mouseover_image.src);jQuery("#ratings_"+post_id+"_text").length&&(jQuery("#ratings_"+post_id+"_text").show(),jQuery("#ratings_"+ post_id+"_text").html(c))}} function ratings_off(a,b,c){if(!is_being_rated){for(i=1;i<=ratingsL10n.max;i++)i<=a?ratingsL10n.custom?jQuery("#rating_"+post_id+"_"+i).attr("src",ratingsL10n.plugin_url+"/images/"+ratingsL10n.image+"/rating_"+i+"_on."+ratingsL10n.image_ext):jQuery("#rating_"+post_id+"_"+i).attr("src",ratingsL10n.plugin_url+"/images/"+ratingsL10n.image+"/rating_on."+ratingsL10n.image_ext):i==b?ratingsL10n.custom?jQuery("#rating_"+post_id+"_"+i).attr("src",ratingsL10n.plugin_url+"/images/"+ratingsL10n.image+"/rating_"+ i+"_half"+(c?"-rtl":"")+"."+ratingsL10n.image_ext):jQuery("#rating_"+post_id+"_"+i).attr("src",ratingsL10n.plugin_url+"/images/"+ratingsL10n.image+"/rating_half"+(c?"-rtl":"")+"."+ratingsL10n.image_ext):ratingsL10n.custom?jQuery("#rating_"+post_id+"_"+i).attr("src",ratingsL10n.plugin_url+"/images/"+ratingsL10n.image+"/rating_"+i+"_off."+ratingsL10n.image_ext):jQuery("#rating_"+post_id+"_"+i).attr("src",ratingsL10n.plugin_url+"/images/"+ratingsL10n.image+"/rating_off."+ratingsL10n.image_ext);jQuery("#ratings_"+ post_id+"_text").length&&(jQuery("#ratings_"+post_id+"_text").hide(),jQuery("#ratings_"+post_id+"_text").empty())}}function set_is_being_rated(a){is_being_rated=a}function rate_post_success(a){jQuery("#post-ratings-"+post_id).html(a);ratingsL10n.show_loading&&jQuery("#post-ratings-"+post_id+"-loading").hide();ratingsL10n.show_fading?jQuery("#post-ratings-"+post_id).fadeTo("def",1,function(){set_is_being_rated(!1)}):set_is_being_rated(!1)} function rate_post(){post_ratings_el=jQuery("#post-ratings-"+post_id);if(is_being_rated)alert(ratingsL10n.text_wait);else{post_ratings_nonce=jQuery(post_ratings_el).data("nonce");if("undefined"==typeof post_ratings_nonce||null==post_ratings_nonce)post_ratings_nonce=jQuery(post_ratings_el).attr("data-nonce");set_is_being_rated(!0);ratingsL10n.show_fading?jQuery(post_ratings_el).fadeTo("def",0,function(){ratingsL10n.show_loading&&jQuery("#post-ratings-"+post_id+"-loading").show();jQuery.ajax({type:"POST", xhrFields:{withCredentials:!0},dataType:"html",url:ratingsL10n.ajax_url,data:"action=postratings&pid="+post_id+"&rate="+post_rating+"&postratings_"+post_id+"_nonce="+post_ratings_nonce,cache:!1,success:rate_post_success})}):(ratingsL10n.show_loading&&jQuery("#post-ratings-"+post_id+"-loading").show(),jQuery.ajax({type:"POST",xhrFields:{withCredentials:!0},dataType:"html",url:ratingsL10n.ajax_url,data:"action=postratings&pid="+post_id+"&rate="+post_rating+"&postratings_"+post_id+"_nonce="+post_ratings_nonce, cache:!1,success:rate_post_success}))}}; jQuery.easing['jswing']=jQuery.easing['swing']; jQuery.extend(jQuery.easing, { def: 'easeOutQuad', swing: function (x, t, b, c, d){ return jQuery.easing[jQuery.easing.def](x, t, b, c, d); }, easeInQuad: function (x, t, b, c, d){ return c*(t/=d)*t + b; }, easeOutQuad: function (x, t, b, c, d){ return -c *(t/=d)*(t-2) + b; }, easeInOutQuad: function (x, t, b, c, d){ if((t/=d/2) < 1) return c/2*t*t + b; return -c/2 * ((--t)*(t-2) - 1) + b; }, easeInCubic: function (x, t, b, c, d){ return c*(t/=d)*t*t + b; }, easeOutCubic: function (x, t, b, c, d){ return c*((t=t/d-1)*t*t + 1) + b; }, easeInOutCubic: function (x, t, b, c, d){ if((t/=d/2) < 1) return c/2*t*t*t + b; return c/2*((t-=2)*t*t + 2) + b; }, easeInQuart: function (x, t, b, c, d){ return c*(t/=d)*t*t*t + b; }, easeOutQuart: function (x, t, b, c, d){ return -c * ((t=t/d-1)*t*t*t - 1) + b; }, easeInOutQuart: function (x, t, b, c, d){ if((t/=d/2) < 1) return c/2*t*t*t*t + b; return -c/2 * ((t-=2)*t*t*t - 2) + b; }, easeInQuint: function (x, t, b, c, d){ return c*(t/=d)*t*t*t*t + b; }, easeOutQuint: function (x, t, b, c, d){ return c*((t=t/d-1)*t*t*t*t + 1) + b; }, easeInOutQuint: function (x, t, b, c, d){ if((t/=d/2) < 1) return c/2*t*t*t*t*t + b; return c/2*((t-=2)*t*t*t*t + 2) + b; }, easeInSine: function (x, t, b, c, d){ return -c * Math.cos(t/d * (Math.PI/2)) + c + b; }, easeOutSine: function (x, t, b, c, d){ return c * Math.sin(t/d * (Math.PI/2)) + b; }, easeInOutSine: function (x, t, b, c, d){ return -c/2 * (Math.cos(Math.PI*t/d) - 1) + b; }, easeInExpo: function (x, t, b, c, d){ return (t==0) ? b:c * Math.pow(2, 10 * (t/d - 1)) + b; }, easeOutExpo: function (x, t, b, c, d){ return (t==d) ? b+c:c * (-Math.pow(2, -10 * t/d) + 1) + b; }, easeInOutExpo: function (x, t, b, c, d){ if(t==0) return b; if(t==d) return b+c; if((t/=d/2) < 1) return c/2 * Math.pow(2, 10 * (t - 1)) + b; return c/2 * (-Math.pow(2, -10 * --t) + 2) + b; }, easeInCirc: function (x, t, b, c, d){ return -c * (Math.sqrt(1 - (t/=d)*t) - 1) + b; }, easeOutCirc: function (x, t, b, c, d){ return c * Math.sqrt(1 - (t=t/d-1)*t) + b; }, easeInOutCirc: function (x, t, b, c, d){ if((t/=d/2) < 1) return -c/2 * (Math.sqrt(1 - t*t) - 1) + b; return c/2 * (Math.sqrt(1 - (t-=2)*t) + 1) + b; }, easeInElastic: function (x, t, b, c, d){ var s=1.70158;var p=0;var a=c; if(t==0) return b; if((t/=d)==1) return b+c; if(!p) p=d*.3; if(a < Math.abs(c)){ a=c; var s=p/4; } else var s=p/(2*Math.PI) * Math.asin (c/a); return -(a*Math.pow(2,10*(t-=1)) * Math.sin((t*d-s)*(2*Math.PI)/p)) + b; }, easeOutElastic: function (x, t, b, c, d){ var s=1.70158;var p=0;var a=c; if(t==0) return b; if((t/=d)==1) return b+c; if(!p) p=d*.3; if(a < Math.abs(c)){ a=c; var s=p/4; } else var s=p/(2*Math.PI) * Math.asin (c/a); return a*Math.pow(2,-10*t) * Math.sin((t*d-s)*(2*Math.PI)/p) + c + b; }, easeInOutElastic: function (x, t, b, c, d){ var s=1.70158;var p=0;var a=c; if(t==0) return b; if((t/=d/2)==2) return b+c; if(!p) p=d*(.3*1.5); if(a < Math.abs(c)){ a=c; var s=p/4; } else var s=p/(2*Math.PI) * Math.asin (c/a); if(t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin((t*d-s)*(2*Math.PI)/p)) + b; return a*Math.pow(2,-10*(t-=1)) * Math.sin((t*d-s)*(2*Math.PI)/p)*.5 + c + b; }, easeInBack: function (x, t, b, c, d, s){ if(s==undefined) s=1.70158; return c*(t/=d)*t*((s+1)*t - s) + b; }, easeOutBack: function (x, t, b, c, d, s){ if(s==undefined) s=1.70158; return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b; }, easeInOutBack: function (x, t, b, c, d, s){ if(s==undefined) s=1.70158; if((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b; return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b; }, easeInBounce: function (x, t, b, c, d){ return c - jQuery.easing.easeOutBounce (x, d-t, 0, c, d) + b; }, easeOutBounce: function (x, t, b, c, d){ if((t/=d) < (1/2.75)){ return c*(7.5625*t*t) + b; }else if(t < (2/2.75)){ return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b; }else if(t < (2.5/2.75)){ return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b; }else{ return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b; }}, easeInOutBounce: function (x, t, b, c, d){ if(t < d/2) return jQuery.easing.easeInBounce (x, t*2, 0, c, d) * .5 + b; return jQuery.easing.easeOutBounce (x, t*2-d, 0, c, d) * .5 + c*.5 + b; }}); (function($){ $.fn.fitVids=function(options){ var settings={ customSelector: null } var div=document.createElement('div'), ref=document.getElementsByTagName('base')[0]||document.getElementsByTagName('script')[0]; div.className='fit-vids-style'; div.innerHTML='­'; ref.parentNode.insertBefore(div,ref); if(options){ $.extend(settings, options); } return this.each(function(){ var selectors=[ "iframe[src*='player.vimeo.com']", "iframe[src*='www.youtube.com']", "iframe[src*='www.kickstarter.com']", "iframe[src*='www.dailymotion.com']", "object", "embed" ]; if(settings.customSelector){ selectors.push(settings.customSelector); } var $allVideos=$(this).find(selectors.join(',')); $allVideos.each(function(){ var $this=$(this); if(this.tagName.toLowerCase()=='embed'&&$this.parent('object').length||$this.parent('.fluid-width-video-wrapper').length){ return; } var height=(this.tagName.toLowerCase()=='object'||$this.attr('height')) ? $this.attr('height'):$this.height(), width=$this.attr('width') ? $this.attr('width'):$this.width(), aspectRatio=height / width; if(!$this.attr('id')){ var videoID='fitvid' + Math.floor(Math.random()*999999); $this.attr('id', videoID); } $this.wrap('
').parent('.fluid-width-video-wrapper').css('padding-top', (aspectRatio * 100)+"%"); $this.removeAttr('height').removeAttr('width'); }); }); }})(jQuery); jQuery(document).ready(function($){ $(".post-video, .video-embed, #portfolio-video, .widget_embed").fitVids(); }); var min_w=1500; var video_width_original=1280; var video_height_original=720; var vid_ratio=1280/720; jQuery(document).ready(function($){ $('.accordion').each(function(){ var acc=$(this).attr("rel") * 2; $(this).find('.accordion-inner:nth-child(' + acc + ')').show(); $(this).find('.accordion-inner:nth-child(' + acc + ')').prev().addClass("active"); }); $('.accordion .accordion-title').click(function(){ if($(this).next().is(':hidden')){ $(this).parent().find('.accordion-title').removeClass('active').next().slideUp(200); $(this).toggleClass('active').next().slideDown(200); } return false; }); $(".alert-message .close").click(function(){ $(this).parent().animate({'opacity':'0'}, 300).slideUp(300); return false; }); $('.skillbar').each(function(){ dataperc=$(this).attr('data-perc'), $(this).find('.skill-percentage').animate({ "width":dataperc + "%"}, dataperc*20); }); $('div.tabset').tabset(); if($(".toggle .toggle-title").hasClass('active')){ $(".toggle .toggle-title.active").closest('.toggle').find('.toggle-inner').show(); } $(".toggle .toggle-title").click(function(){ if($(this).hasClass('active')){ $(this).removeClass("active").closest('.toggle').find('.toggle-inner').slideUp(200); }else{ $(this).addClass("active").closest('.toggle').find('.toggle-inner').slideDown(200); }}); vid_w_orig=parseInt($('video').attr('width')); vid_h_orig=parseInt($('video').attr('height')); $(window).resize(function (){ resizeToCover(); }); $(window).trigger('resize'); function resizeToCover(){ $('.videosection .video-wrap').each(function(i){ var $sectionWidth=$(this).closest('.videosection').outerWidth(); var $sectionHeight=$(this).closest('.videosection').outerHeight(); $(this).width($sectionWidth); $(this).height($sectionHeight); var scale_h=$sectionWidth / video_width_original; var scale_v=$sectionHeight / video_height_original; var scale=scale_h > scale_v ? scale_h:scale_v; min_w=vid_ratio * ($sectionHeight+20); if(scale * video_width_original < min_w){scale=min_w / video_width_original;} $(this).find('video, .mejs-overlay, .mejs-poster').width(Math.ceil(scale * video_width_original +2)); $(this).find('video, .mejs-overlay, .mejs-poster').height(Math.ceil(scale * video_height_original +2)); $(this).scrollLeft(($(this).find('video').width() - $sectionWidth) / 2); $(this).find('.mejs-overlay, .mejs-poster').scrollTop(($(this).find('video').height() - ($sectionHeight)) / 2); $(this).scrollTop(($(this).find('video').height() - ($sectionHeight)) / 2); }); } }); (function ($){ $.fn.tabset=function (){ var $tabsets=$(this); $tabsets.each(function (i){ var $tabs=$('li.tab a', this); $tabs.click(function (e){ var $this=$(this); panels=$.map($tabs, function (val, i){ return $(val).attr('href'); }); $(panels.join(',')).hide(); $tabs.removeClass('selected'); $this.addClass('selected').blur(); $($this.attr('href')).show(); e.preventDefault(); return false; }).first().triggerHandler('click'); }); };})(jQuery); !function ($){ "use strict"; var Tooltip=function (element, options){ this.init('tooltip', element, options) } Tooltip.prototype={ constructor: Tooltip , init: function (type, element, options){ var eventIn , eventOut this.type=type this.$element=$(element) this.options=this.getOptions(options) this.enabled=true if(this.options.trigger=='click'){ this.$element.on('click.' + this.type, this.options.selector, $.proxy(this.toggle, this)) }else if(this.options.trigger!='manual'){ eventIn=this.options.trigger=='hover' ? 'mouseenter':'focus' eventOut=this.options.trigger=='hover' ? 'mouseleave':'blur' this.$element.on(eventIn + '.' + this.type, this.options.selector, $.proxy(this.enter, this)) this.$element.on(eventOut + '.' + this.type, this.options.selector, $.proxy(this.leave, this)) } this.options.selector ? (this._options=$.extend({}, this.options, { trigger: 'manual', selector: '' })) : this.fixTitle() } , getOptions: function (options){ options=$.extend({}, $.fn[this.type].defaults, options, this.$element.data()) if(options.delay&&typeof options.delay=='number'){ options.delay={ show: options.delay , hide: options.delay }} return options } , enter: function (e){ var self=$(e.currentTarget)[this.type](this._options).data(this.type) clearTimeout(this.removeTimeout) if(!self.options.delay||!self.options.delay.show) return self.show() clearTimeout(this.timeout) self.hoverState='in' this.timeout=setTimeout(function(){ if(self.hoverState=='in') self.show() }, self.options.delay.show) } , leave: function (e){ var self=$(e.currentTarget)[this.type](this._options).data(this.type) if(this.timeout) clearTimeout(this.timeout) if(!self.options.delay||!self.options.delay.hide) return self.hide() self.hoverState='out' this.timeout=setTimeout(function(){ if(self.hoverState=='out') self.hide() }, self.options.delay.hide) } , show: function (){ var $tip , inside , pos , actualWidth , actualHeight , placement , tp if(this.hasContent()&&this.enabled){ $tip=this.tip() this.setContent() if(this.options.animation){ $tip.addClass('fade') } placement=typeof this.options.placement=='function' ? this.options.placement.call(this, $tip[0], this.$element[0]) : this.options.placement inside=/in/.test(placement) $tip .remove() .css({ top: 0, left: 0, display: 'block' }) .appendTo(inside ? this.$element:document.body) pos=this.getPosition(inside) actualWidth=$tip[0].offsetWidth actualHeight=$tip[0].offsetHeight switch (inside ? placement.split(' ')[1]:placement){ case 'bottom': tp={top: pos.top + pos.height, left: pos.left + pos.width / 2 - actualWidth / 2} break case 'top': tp={top: pos.top - actualHeight, left: pos.left + pos.width / 2 - actualWidth / 2} break case 'left': tp={top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth} break case 'right': tp={top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width} break } $tip .css(tp) .addClass(placement) .addClass('in') }} , setContent: function (){ var $tip=this.tip() , title=this.getTitle() $tip.find('.tooltip-inner')[this.options.html ? 'html':'text'](title) $tip.removeClass('fade in top bottom left right') } , hide: function (){ var that=this , $tip=this.tip() $tip.removeClass('in') function removeWithAnimation(){ that.removeTimeout=setTimeout(function (){ $tip.off($.support.transition.end).remove() }, 500) $tip.one($.support.transition.end, function (){ clearTimeout(that.removeTimeout) $tip.remove() }) } $.support.transition&&this.$tip.hasClass('fade') ? removeWithAnimation() : $tip.remove() return this } , fixTitle: function (){ var $e=this.$element if($e.attr('title')||typeof($e.attr('data-original-title'))!='string'){ $e.attr('data-original-title', $e.attr('title')||'').removeAttr('title') }} , hasContent: function (){ return this.getTitle() } , getPosition: function (inside){ return $.extend({}, (inside ? {top: 0, left: 0}:this.$element.offset()), { width: this.$element[0].offsetWidth , height: this.$element[0].offsetHeight }) } , getTitle: function (){ var title , $e=this.$element , o=this.options title=$e.attr('data-original-title') || (typeof o.title=='function' ? o.title.call($e[0]):o.title) return title } , tip: function (){ return this.$tip=this.$tip||$(this.options.template) } , validate: function (){ if(!this.$element[0].parentNode){ this.hide() this.$element=null this.options=null }} , enable: function (){ this.enabled=true } , disable: function (){ this.enabled=false } , toggleEnabled: function (){ this.enabled = !this.enabled } , toggle: function (){ this[this.tip().hasClass('in') ? 'hide':'show']() } , destroy: function (){ this.hide().$element.off('.' + this.type).removeData(this.type) }} $.fn.tooltip=function(option){ return this.each(function (){ var $this=$(this) , data=$this.data('tooltip') , options=typeof option=='object'&&option if(!data) $this.data('tooltip', (data=new Tooltip(this, options))) if(typeof option=='string') data[option]() }) } $.fn.tooltip.Constructor=Tooltip $.fn.tooltip.defaults={ animation: true , placement: 'top' , selector: false , template: '
' , trigger: 'hover' , title: '' , delay: 0 , html: true }}(window.jQuery); jQuery(document).ready(function($){ $('.meta-category a, .meta-author a').tooltip({placement: 'top'}); $('.tooltips').tooltip({ selector: "a[rel=tooltip]" }); $('#topbar .social-icons a').tooltip({placement: 'bottom', animation: true}); $('.sharebox .social-icons a').tooltip({placement: 'top'}); $('.member-social a').tooltip({placement: 'top'}); $('#copyright .social-icons a').tooltip({placement: 'top'}); $('.social-icon a').tooltip({placement: 'top'}); $('.portfolio-widget-item a').tooltip({placement: 'bottom'}); $('#header-cart').tooltip({placement: 'top'}); }); (function ($){ "use strict"; var methods=(function (){ var c={ bcClass: 'sf-breadcrumb', menuClass: 'sf-js-enabled', anchorClass: 'sf-with-ul', menuArrowClass: 'sf-arrows' }, ios=(function (){ var ios=/iPhone|iPad|iPod/i.test(navigator.userAgent); if(ios){ $(window).load(function (){ $('body').children().on('click', $.noop); }); } return ios; })(), wp7=(function (){ var style=document.documentElement.style; return ('behavior' in style&&'fill' in style&&/iemobile/i.test(navigator.userAgent)); })(), toggleMenuClasses=function ($menu, o){ var classes=c.menuClass; if(o.cssArrows){ classes +=' ' + c.menuArrowClass; } $menu.toggleClass(classes); }, setPathToCurrent=function ($menu, o){ return $menu.find('li.' + o.pathClass).slice(0, o.pathLevels) .addClass(o.hoverClass + ' ' + c.bcClass) .filter(function (){ return ($(this).children(o.popUpSelector).hide().show().length); }).removeClass(o.pathClass); }, toggleAnchorClass=function ($li){ $li.children('a').toggleClass(c.anchorClass); }, toggleTouchAction=function ($menu){ var touchAction=$menu.css('ms-touch-action'); touchAction=(touchAction==='pan-y') ? 'auto':'pan-y'; $menu.css('ms-touch-action', touchAction); }, applyHandlers=function ($menu, o){ var targets='li:has(' + o.popUpSelector + ')'; if($.fn.hoverIntent&&!o.disableHI){ $menu.hoverIntent(over, out, targets); }else{ $menu .on('mouseenter.superfish', targets, over) .on('mouseleave.superfish', targets, out); } var touchevent='MSPointerDown.superfish'; if(!ios){ touchevent +=' touchend.superfish'; } if(wp7){ touchevent +=' mousedown.superfish'; } $menu .on('focusin.superfish', 'li', over) .on('focusout.superfish', 'li', out) .on(touchevent, 'a', o, touchHandler); }, touchHandler=function (e){ var $this=$(this), $ul=$this.siblings(e.data.popUpSelector); if($ul.length > 0&&$ul.is(':hidden')){ $this.one('click.superfish', false); if(e.type==='MSPointerDown'){ $this.trigger('focus'); }else{ $.proxy(over, $this.parent('li'))(); }} }, over=function (){ var $this=$(this), o=getOptions($this); clearTimeout(o.sfTimer); $this.siblings().superfish('hide').end().superfish('show'); }, out=function (){ var $this=$(this), o=getOptions($this); if(ios){ $.proxy(close, $this, o)(); }else{ clearTimeout(o.sfTimer); o.sfTimer=setTimeout($.proxy(close, $this, o), o.delay); }}, close=function (o){ o.retainPath=($.inArray(this[0], o.$path) > -1); this.superfish('hide'); if(!this.parents('.' + o.hoverClass).length){ o.onIdle.call(getMenu(this)); if(o.$path.length){ $.proxy(over, o.$path)(); }} }, getMenu=function ($el){ return $el.closest('.' + c.menuClass); }, getOptions=function ($el){ return getMenu($el).data('sf-options'); }; return { hide: function (instant){ if(this.length){ var $this=this, o=getOptions($this); if(!o){ return this; } var not=(o.retainPath===true) ? o.$path:'', $ul=$this.find('li.' + o.hoverClass).add(this).not(not).removeClass(o.hoverClass).children(o.popUpSelector), speed=o.speedOut; if(instant){ $ul.show(); speed=0; } o.retainPath=false; o.onBeforeHide.call($ul); $ul.stop(true, true).animate(o.animationOut, speed, function (){ var $this=$(this); o.onHide.call($this); }); } return this; }, show: function (){ var o=getOptions(this); if(!o){ return this; } var $this=this.addClass(o.hoverClass), $ul=$this.children(o.popUpSelector); o.onBeforeShow.call($ul); $ul.stop(true, true).animate(o.animation, o.speed, function (){ o.onShow.call($ul); }); return this; }, destroy: function (){ return this.each(function (){ var $this=$(this), o=$this.data('sf-options'), $hasPopUp; if(!o){ return false; } $hasPopUp=$this.find(o.popUpSelector).parent('li'); clearTimeout(o.sfTimer); toggleMenuClasses($this, o); toggleAnchorClass($hasPopUp); toggleTouchAction($this); $this.off('.superfish').off('.hoverIntent'); $hasPopUp.children(o.popUpSelector).attr('style', function (i, style){ return style.replace(/display[^;]+;?/g, ''); }); o.$path.removeClass(o.hoverClass + ' ' + c.bcClass).addClass(o.pathClass); $this.find('.' + o.hoverClass).removeClass(o.hoverClass); o.onDestroy.call($this); $this.removeData('sf-options'); }); }, init: function (op){ return this.each(function (){ var $this=$(this); if($this.data('sf-options')){ return false; } var o=$.extend({}, $.fn.superfish.defaults, op), $hasPopUp=$this.find(o.popUpSelector).parent('li'); o.$path=setPathToCurrent($this, o); $this.data('sf-options', o); toggleMenuClasses($this, o); toggleAnchorClass($hasPopUp); toggleTouchAction($this); applyHandlers($this, o); $hasPopUp.not('.' + c.bcClass).superfish('hide', true); o.onInit.call(this); }); }};})(); $.fn.superfish=function (method, args){ if(methods[method]){ return methods[method].apply(this, Array.prototype.slice.call(arguments, 1)); } else if(typeof method==='object'||! method){ return methods.init.apply(this, arguments); }else{ return $.error('Method ' + method + ' does not exist on jQuery.fn.superfish'); }}; $.fn.superfish.defaults={ popUpSelector: 'ul,.sf-mega', hoverClass: 'sfHover', pathClass: 'overrideThisToUse', pathLevels: 1, delay: 800, animation: {opacity: 'show'}, animationOut: {opacity: 'hide'}, speed: 'normal', speedOut: 'fast', cssArrows: true, disableHI: false, onInit: $.noop, onBeforeShow: $.noop, onShow: $.noop, onBeforeHide: $.noop, onHide: $.noop, onIdle: $.noop, onDestroy: $.noop }; $.fn.extend({ hideSuperfishUl: methods.hide, showSuperfishUl: methods.show }); })(jQuery); (function($){$.fn.hoverIntent=function(handlerIn,handlerOut,selector){var cfg={interval:100,sensitivity:6,timeout:0};if(typeof handlerIn==="object"){cfg=$.extend(cfg,handlerIn)}else{if($.isFunction(handlerOut)){cfg=$.extend(cfg,{over:handlerIn,out:handlerOut,selector:selector})}else{cfg=$.extend(cfg,{over:handlerIn,out:handlerIn,selector:handlerOut})}}var cX,cY,pX,pY;var track=function(ev){cX=ev.pageX;cY=ev.pageY};var compare=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);if(Math.sqrt((pX-cX)*(pX-cX)+(pY-cY)*(pY-cY))',{ 'class':settings.className }).insertAfter(el); $('